<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文章中心</title>
    <link rel="stylesheet" href="__STATIC__/admin/js/layer/theme/default/layer.css">
    <link rel="stylesheet" href="__STATIC__/admin/js/layui/css/layui.css">
    <link rel="stylesheet" href="__STATIC__/admin/js/bootstrap/css/bootstrap.css">
    <script src="__STATIC__/admin/js/html5shiv.min.js"></script>
    <script src="__STATIC__/admin/js/respond.min.js"></script>
    <![endif]-->
    <script src="__STATIC__/admin/js/jquery.min.js"></script>
    <script src="__STATIC__/admin/js/bootstrap/js/bootstrap.min.js"></script>
    <script src="__STATIC__/admin/js/common.js"></script>
    <script src="__STATIC__/admin/js/plugins.js"></script>
    <script src="__STATIC__/admin/js/layer/layer.js"></script>
</head>
<body>
<table class="table table-hover">
    <tr>
        <td>ID</td>
        <td>文章标题</td>
        <td>文章内容</td>
        <td>发布时间</td>
        <td>发布ID</td>
        <td>发布名称</td>
        <td>操作</td>
    </tr>
    {volist name="res" id="vo"}
        <tr>
            <td>{$vo.article_id}</td>
            <td><div style=" width:100px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{$vo.article_title}</div></td>
            <td><div style=" width:250px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;">{$vo.article_content}</div></td>
            <td>{$vo.article_time|date="Y-m-d H:i",###}</td>
            <td>{$vo.user_id}</td>
            <td>{$vo.user_name}</td>
            <td>
                <button class="del layui-btn layui-btn-danger" data-id="{$vo.article_id}"><i class="layui-icon"></i>删除</button>
            </td>
        </tr>
    {/volist}
</table>
</body>
<script>
    $(document).ready(function(){
        $(".del").click(function () {
            var link = $(this);
            var id = link.attr("data-id");
            var msg ='您确定要进行操作吗?';
            Plugins.confirm({title:'信息提示',content:msg,okText:'确定',cancelText:'取消',okFun:function(){
                $.get("{:url('admin/article/delete')}?id="+id,function(data){
                    if(data == 1){
                        layer.msg('改变成功');
                        setTimeout(function(){window.location.reload();},2000);
                    }else{
                        layer.msg('改变成功');
                        setTimeout(function(){window.location.reload();},2000);

                    }
                });
            }});
        })
    })

</script>
</html>